package com.syf.chatting.utils;

import com.syf.chatting.domain.User;
import com.syf.chatting.vo.Result;
import org.thymeleaf.util.StringUtils;

/**
 * Created by sunyf on 2017/10/10.
 */
public class MyUtil {

    public static Result errResult = new Result(999,"未知错误",null);

    public static String vilatedUser(User user){
        if(user == null)
            return "用户不能为空";
        else
        {
            if(StringUtils.isEmpty(user.getName())){
                return "用户名不能为空";
            }else if(StringUtils.isEmpty(user.getPassword())){
                return "用户密码不能为空";
            }else if(user.getPhone() == null){
                return "手机号不能为空";
            }else if(user.getAppId() == null){
                return "appId不能为空";
            }else {
                return "";
            }

        }
    }
}
